package com.atguigu.gmall.order.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.client.impl.OrderDegradeFeignClient;
import com.atguigu.gmall.order.model.OrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * title:
 * author: Gyh
 * date:2023-05-07 14:31
 * Description:
 */
@FeignClient(value = "service-order",fallback = OrderDegradeFeignClient.class,path = "/api/order")
public interface OrderFeignClient {

    /**
     * 渲染用户订单确认页面相关参数
     * @return
     */
    @GetMapping("/auth/trade")
    public Result<Map> tradeDatas();

    /**
     * 根据订单Id查询订单信息,包括订单的明细
     * @param orderId
     * @return
     */
    @GetMapping("/inner/getOrderInfo/{orderId}")
    public OrderInfo getOrderInfoById(@PathVariable("orderId") Long orderId);
}
